Public Class MessageBox
    Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub
    Protected WithEvents btnOK As System.Web.UI.WebControls.Button
    Protected WithEvents lblMsg As System.Web.UI.WebControls.Label

    'NOTE: The following placeholder declaration is required by the Web Form Designer.
    'Do not delete or move it.
    Private designerPlaceholderDeclaration As System.Object

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: This method call is required by the Web Form Designer
        'Do not modify it using the code editor.
        InitializeComponent()
    End Sub

#End Region

    Public Const CONTEXT_REDIRECT_URL As String = "url"
    Public Const CONTEXT_MSG As String = "msg"

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here
        If Not Page.IsPostBack Then
            If context.Items(Me.CONTEXT_REDIRECT_URL) Is Nothing Then
                btnOK.CommandArgument = AppRoot()
            Else
                btnOK.CommandArgument = CStr(context.Items(Me.CONTEXT_REDIRECT_URL))
            End If

            If context.Items(Me.CONTEXT_MSG) Is Nothing Then
                lblMsg.Text = ""
            Else
                lblMsg.Text = CStr(context.Items(Me.CONTEXT_MSG))
            End If
        End If
    End Sub

    Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
        Response.Redirect(btnOK.CommandArgument)
    End Sub
End Class
